﻿Imports AccesoDatos

Public Class CatalogoCajero
    Public Function BandejaPedidosPendientes(ByVal pstrLocal As String, ByVal pstrMozo As String, ByVal pstrMesa As String) As DataSet
        Dim dsConsultaDatos As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                       {"@MOZO", SqlDbType.VarChar, UCase(pstrMozo)}, _
                                       {"@MESA", SqlDbType.VarChar, UCase(pstrMesa)}}
        dsConsultaDatos = objCom.ExecSPDataSetCP("SP_BANDEJA_PEDIDOS_PENDIENTES", Parametros)
        Return dsConsultaDatos
    End Function

    Public Function CancelaPedidosPendientes(ByVal pstrID As String, ByVal pstrLocal As String, ByVal pstrCliente As String, ByVal pstrUsuario As String) As Integer
        Dim Resultado As Integer
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@ID", SqlDbType.VarChar, UCase(pstrID)}, _
                                        {"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                        {"@CLIENTE", SqlDbType.VarChar, UCase(pstrCliente)}, _
                                        {"@USUARIO", SqlDbType.VarChar, UCase(pstrUsuario)}}
        Resultado = objCom.ExecSPIntegerCP("SP_CANCELAPEDIDO", Parametros)
        Return Resultado
    End Function


    Public Function ReporteVentas(ByVal pstrLocal As String, ByVal pstrFecha As String, ByVal pstrMozo As String) As DataSet
        Dim Resultado As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                        {"@FECHA", SqlDbType.VarChar, UCase(pstrFecha)}, _
                                       {"@MOZO", SqlDbType.VarChar, UCase(pstrMozo)}}
        Resultado = objCom.ExecSPDataSetCP("SP_REPORTE_VENTA_xDIA", Parametros)
        Return Resultado
    End Function
    Public Function ReporteVentas(ByVal pstrLocal As String, ByVal pstrFecha As String, ByVal pstrMozo As String, ByVal pstrPedido As String) As DataSet
        Dim Resultado As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                        {"@FECHA", SqlDbType.VarChar, UCase(pstrFecha)}, _
                                       {"@MOZO", SqlDbType.VarChar, UCase(pstrMozo)}, _
                                       {"@PEDIDO", SqlDbType.VarChar, UCase(pstrPedido)}}
        Resultado = objCom.ExecSPDataSetCP("SP_REPORTE_VENTA_xDIA_DETALLE", Parametros)
        Return Resultado
    End Function


   
    'COMPRAS
    Public Function InsertaCompraTemp(ByVal pstrLocal As String, ByVal pstrFecha As String, ByVal pstrItem_ID As String, ByVal pstrItem As String, _
                                           ByVal pstrCantidad As String, ByVal pstrUnidad As String, ByVal pstrTotal As String, _
                                           ByVal pstrUsuario As String) As Integer
        Dim Resultado As Integer
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                        {"@FECHA", SqlDbType.VarChar, UCase(pstrFecha)}, _
                                        {"@INSUMO_ID", SqlDbType.VarChar, pstrItem_ID}, _
                                        {"@INSUMO", SqlDbType.VarChar, UCase(pstrItem)}, _
                                        {"@CTD", SqlDbType.VarChar, UCase(pstrCantidad)}, _
                                        {"@UND", SqlDbType.VarChar, UCase(pstrUnidad)}, _
                                        {"@TOTAL", SqlDbType.VarChar, UCase(pstrTotal)}, _
                                        {"@USUARIO", SqlDbType.VarChar, UCase(pstrUsuario)}}
        Resultado = objCom.ExecSPIntegerCP("SP_INSERTA_COMPRATEMPORAL", Parametros)
        Return Resultado
    End Function

    Public Function EliminaCompraTemp(ByVal pstrLocal As String, ByVal pstrFecha As String, ByVal pstrID As String) As Integer
        Dim Resultado As Integer
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                        {"@FECHA", SqlDbType.VarChar, UCase(pstrFecha)}, _
                                        {"@ID", SqlDbType.VarChar, pstrID}}
        Resultado = objCom.ExecSPIntegerCP("SP_ELIMINA_COMPRATEMPORAL", Parametros)
        Return Resultado
    End Function

    Public Function BandejaCompraTemp(ByVal pstrLocal As String, ByVal pstrFecha As String) As Dataset
        Dim Resultado As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                        {"@FECHA", SqlDbType.VarChar, UCase(pstrFecha)}}
        Resultado = objCom.ExecSPDataSetCP("SP_BANDEJA_COMPRATEMP", Parametros)
        Return Resultado
    End Function

    Public Function TotalCompraTemp(ByVal pstrLocal As String, ByVal pstrFecha As String) As DataSet
        Dim Resultado As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                        {"@FECHA", SqlDbType.VarChar, UCase(pstrFecha)}}
        Resultado = objCom.ExecSPDataSetCP("SP_TOTAL_COMPRATEMPORAL", Parametros)
        Return Resultado
    End Function

    Public Function InsertaCompra(ByVal pstrLocal As String, ByVal pstrFecha As String, ByVal pstrProveedor As String, ByVal pstrNomProveedor As String, _
                                          ByVal pstrTipo As String, ByVal pstrNum As String, ByVal pstrUsuario As String) As Integer
        Dim Resultado As Integer
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                        {"@FECHA", SqlDbType.VarChar, UCase(pstrFecha)}, _
                                        {"@PROVEEDOR", SqlDbType.VarChar, UCase(pstrProveedor)}, _
                                        {"@NOMPROVEEDOR", SqlDbType.VarChar, UCase(pstrNomProveedor)}, _
                                        {"@TIPO", SqlDbType.VarChar, UCase(pstrTipo)}, _
                                        {"@NUM", SqlDbType.VarChar, UCase(pstrNum)}, _
                                        {"@USUARIO", SqlDbType.VarChar, UCase(pstrUsuario)}}

        Resultado = objCom.ExecSPIntegerCP("SP_INSERTA_COMPRA", Parametros)
        Return Resultado
    End Function


    Public Function ReporteCompras(ByVal pstrLocal As String, ByVal pstrFecha As String, ByVal pstrGrupo As String) As DataSet
        Dim Resultado As DataSet
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                        {"@FECHA", SqlDbType.VarChar, UCase(pstrFecha)}, _
                                       {"@GRUPO", SqlDbType.VarChar, UCase(pstrGrupo)}}
        Resultado = objCom.ExecSPDataSetCP("SP_REPORTE_COMPRA_xDIA_DETALLE", Parametros)
        Return Resultado
    End Function


    '******************************************
    'ADELANTOS, PRESTAMOS y PAGOS
    '*****************************************

    Public Function InsertaPago(ByVal pstrLocal As String, ByVal pstrFecha As String, ByVal pstrTipo As String, _
                                  ByVal pstrPadre As String, ByVal pstrHijo As String, _
                                           ByVal pstrTotal As String, ByVal pstrUsuario As String) As Integer
        Dim Resultado As Integer
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                        {"@FECHA", SqlDbType.VarChar, UCase(pstrFecha)}, _
                                        {"@TIPO", SqlDbType.VarChar, UCase(pstrTipo)}, _
                                        {"@PADRE", SqlDbType.VarChar, UCase(pstrPadre)}, _
                                        {"@HIJO", SqlDbType.VarChar, UCase(pstrHijo)}, _
                                        {"@TOTAL", SqlDbType.VarChar, UCase(pstrTotal)}, _
                                        {"@USUARIO", SqlDbType.VarChar, UCase(pstrUsuario)}}

        Resultado = objCom.ExecSPIntegerCP("SP_INSERTA_PAGO", Parametros)
        Return Resultado
    End Function

    '*******************************************
    'TRANSFERENCIAS
    '*****************************************
    Public Function InsertaTransferencia(ByVal pstrLocal As String, ByVal pstrFecha As String, _
                                    ByVal pstrDesde As String, ByVal pstrHacia As String, _
                                   ByVal pstrProveedor As String, ByVal pstrTipo As String, _
                                  ByVal pstrNumero As String, ByVal pstrCantidad As String, _
                                           ByVal pstrInsumo As String, ByVal pstrUsuario As String) As Integer
        Dim Resultado As Integer
        Dim objCom As New BaseDatos
        Dim Parametros(,) As Object = {{"@LOCAL", SqlDbType.VarChar, UCase(pstrLocal)}, _
                                        {"@FECHA", SqlDbType.VarChar, UCase(pstrFecha)}, _
                                        {"@DESDE", SqlDbType.VarChar, UCase(pstrDesde)}, _
                                        {"@HACIA", SqlDbType.VarChar, UCase(pstrHacia)}, _
                                        {"@PROVEEDOR", SqlDbType.VarChar, UCase(pstrProveedor)}, _
                                        {"@TIPO", SqlDbType.VarChar, UCase(pstrTipo)}, _
                                        {"@NUMERO", SqlDbType.VarChar, UCase(pstrNumero)}, _
                                        {"@CANTIDAD", SqlDbType.VarChar, UCase(pstrCantidad)}, _
                                        {"@INSUMO", SqlDbType.VarChar, pstrInsumo}, _
                                        {"@USUARIO", SqlDbType.VarChar, UCase(pstrUsuario)}}

        Resultado = objCom.ExecSPIntegerCP("SP_INSERTA_TRANSFERENCIA ", Parametros)
        Return Resultado
    End Function

    '*********************
    'APERTURA DE CAJA
    '***********************




    '**********************
    'CIERRE DE CAJA
    '*********************



End Class
